const mysql = require('mysql');
// 数据库连接配置
const pool = mysql.createPool({
    connectionLimit : 10,
    host     : 'localhost',
    user     : 'root',
    password : '123456',
    database : 'hotel',
    multipleStatements:true,
});
pool.on('enqueue', function (sequence) {
    if ('Query' === sequence.constructor.name) {
        console.log('enqueue',sequence.sql);
    }
});
pool.on('connection', function (conn) { 
    conn.on('enqueue', function(sequence) {
        if ('Query' === sequence.constructor.name) {
            console.log('connection',sequence.sql);
        }
    });
});
module.exports=pool